package SocialMediaSentiment;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Iterator;


public class testPerceptron {
	public static void main(String args[])throws IOException
	{
		FileWriter outFile = new FileWriter("perceptrontest.txt");
		PrintWriter out = new PrintWriter(outFile);
		int sentiment;
		double alpha = 0.001;
		int iterations = 20;
		String tweet;
		HashMap<Integer, String[]> tweetsWithSentiment = ReadExcel. read("Trainset.xls", 9,4);
		Iterator<Integer> k = (Iterator<Integer>) tweetsWithSentiment.keySet().iterator();
		String[] data;
		while(k.hasNext()){
			data = tweetsWithSentiment.get(k.next());
			tweet = data[0];
			sentiment = Integer.parseInt(data[1]);
				Perceptron.PerceptronSingleTweet(tweet,sentiment,alpha, iterations, out);
			}
		
		out.close();
		Perceptron.printWeigthlist();
	}

}
